package com.zone.module_base.fragment

import android.os.Bundle
import com.zone.core.base.BaseBindingViewModelFragment
import com.zone.core.ext.navigate
import com.zone.module_base.databinding.FragmentTestFunctionBinding
import com.zone.module_base.BaseApp
import com.zone.module_base.viewmodel.TestFunctionViewModel

class TestFunctionFragment :
    BaseBindingViewModelFragment<FragmentTestFunctionBinding, TestFunctionViewModel>() {
    override fun inject() {
        BaseApp.appComponent.inject(this)
    }

    override fun onEvent(eventId: Int) {
        super.onEvent(eventId)
        when (eventId) {


            1 -> {
                val directions =
                    TestFunctionFragmentDirections.actionTestFunctionFragmentToTestDownload()
                navigate(directions)
            }

            2 -> {
                val directions =
                    TestFunctionFragmentDirections.actionTestFunctionFragmentToTestHotFix()
                navigate(directions)
            }

            3 -> {
                val directions =
                    TestFunctionFragmentDirections.actionTestFunctionFragmentToTestImage()
                navigate(directions)
            }

            4 -> {
                val directions =
                    TestFunctionFragmentDirections.actionTestFunctionFragmentToTestWebView()
                navigate(directions)
            }

            5 -> {
                val directions =
                    TestFunctionFragmentDirections.actionTestFunctionFragmentToTestVideo()

                val bundle = Bundle()
                bundle.putString("title", "播放器-2-")
                navigate(directions.actionId, bundle)
            }
        }
    }

}